package com.example.springboot_ssm.controller;

import com.example.springboot_ssm.pojo.Member;
import com.example.springboot_ssm.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class MemberController {

    @Autowired
    private MemberService memberService;


    @RequestMapping("/toMemberPage")
    public String toMemberPage(Integer id, Model model){


        System.out.println("welcome in controller......");

        Member member = memberService.getUserById(id);
        model.addAttribute(member);
        System.out.println("good byb controller......");
        return  "MemberPage";

    }
}
